Skip to content

refactor: replace rmm::device_scalar with cudf::detail::device_scalar - #23618

Draft
vyasr wants to merge 2 commits into
NVIDIA:mainfrom
vyasr:drop-rmm-device-scalar
Draft

refactor: replace rmm::device_scalar with cudf::detail::device_scalar#23618
vyasr wants to merge 2 commits into
NVIDIA:mainfrom
vyasr:drop-rmm-device-scalar

Conversation

@vyasr

@vyasr vyasr commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Replaces libcudf's direct rmm::device_scalar usage with cudf::detail::device_scalar, which now owns size-1 rmm::device_uvector storage directly. Also removes the final rmm::device_scalar<cuda::std::atomic_flag> use in groupby hash aggregation by using a size-1 rmm::device_uvector instead. The developer guide is updated accordingly.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

vyasr added 2 commits August 10, 2026 18:36
Introduce a self-contained cudf::detail::device_scalar<T> wrapper (size-1 rmm::device_uvector storage) and migrate all libcudf source, tests, and libcudf_streaming to use it. Updates the scalar hierarchy ctor signatures from rmm::device_scalar<T> to cudf::detail::device_scalar<T> (public API change), refreshes DEVELOPER_GUIDE.md guidance.

This completes plan drop-rmm-device-scalar.md. A follow-up change removes the final rmm::device_scalar usage in compute_single_pass_aggs.cuh.
Replace the exemption rmm::device_scalar<cuda::std::atomic_flag> in compute_single_pass_aggs.cuh with rmm::device_uvector<cuda::std::atomic_flag> of size 1 — semantically identical (device_scalar is a size-1 device_uvector under the hood) but eliminates the last direct rmm::device_scalar reference from libcudf source. atomic_flag cannot use cudf::detail::device_scalar because it is not trivially copyable, but device_uvector has no such requirement.

Completes plan drop-final-rmm-device-scalar-usage.md.
@copy-pr-bot

copy-pr-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Aug 11, 2026
[[nodiscard]] T const* data() const noexcept { return _storage.data(); }

private:
rmm::device_uvector<T> _storage;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just go straight to cuda::buffer here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose not to, I'd prefer to do all the cuda::buffer switches concurrently so that reviewers can see the type in action in multiple places at once for comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libcudf Affects libcudf (C++/CUDA) code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants